2000W / 48V LLC Battery-Charger  V1.00
xmc_i2c.c File Reference
#include <xmc_i2c.h>
Include dependency graph for xmc_i2c.c:

Go to the source code of this file.

Macros

#define XMC_I2C_7BIT_ADDR_Pos   (8U)
 
#define TRANSMISSION_MODE   (3U)
 
#define WORDLENGTH   (7U)
 
#define SET_TDV   (1U)
 
#define XMC_I2C_10BIT_ADDR_MASK   (0x7C00U)
 

Typedefs

typedef enum XMC_I2C_CH_TDF XMC_I2C_CH_TDF_t
 
typedef enum XMC_I2C_CH_MAX_SPEED XMC_I2C_CH_MAX_SPEED_t
 
typedef enum XMC_I2C_CH_CLOCK_OVERSAMPLING XMC_I2C_CH_CLOCK_OVERSAMPLINGS_t
 

Enumerations

enum  XMC_I2C_CH_TDF {
  XMC_I2C_CH_TDF_MASTER_SEND = 0U, XMC_I2C_CH_TDF_SLAVE_SEND = (uint32_t)1U << 8U, XMC_I2C_CH_TDF_MASTER_RECEIVE_ACK = (uint32_t)2U << 8U, XMC_I2C_CH_TDF_MASTER_RECEIVE_NACK = (uint32_t)3U << 8U,
  XMC_I2C_CH_TDF_MASTER_START = (uint32_t)4U << 8U, XMC_I2C_CH_TDF_MASTER_RESTART = (uint32_t)5U << 8U, XMC_I2C_CH_TDF_MASTER_STOP = (uint32_t)6U << 8U
}
 
enum  XMC_I2C_CH_MAX_SPEED { XMC_I2C_CH_MAX_SPEED_STANDARD = 100000U, XMC_I2C_CH_MAX_SPEED_FAST = 400000U }
 
enum  XMC_I2C_CH_CLOCK_OVERSAMPLING { XMC_I2C_CH_CLOCK_OVERSAMPLING_STANDARD = 10U, XMC_I2C_CH_CLOCK_OVERSAMPLING_FAST = 25U }
 

Functions

void XMC_I2C_CH_Init (XMC_USIC_CH_t *const channel, const XMC_I2C_CH_CONFIG_t *const config)
 
void XMC_I2C_CH_SetSlaveAddress (XMC_USIC_CH_t *const channel, const uint16_t address)
 
uint16_t XMC_I2C_CH_GetSlaveAddress (const XMC_USIC_CH_t *const channel)
 
XMC_I2C_CH_STATUS_t XMC_I2C_CH_SetBaudrate (XMC_USIC_CH_t *const channel, uint32_t rate)
 
void XMC_I2C_CH_MasterStart (XMC_USIC_CH_t *const channel, const uint16_t addr, const XMC_I2C_CH_CMD_t command)
 
void XMC_I2C_CH_MasterRepeatedStart (XMC_USIC_CH_t *const channel, const uint16_t addr, const XMC_I2C_CH_CMD_t command)
 
void XMC_I2C_CH_MasterStop (XMC_USIC_CH_t *const channel)
 
void XMC_I2C_CH_MasterTransmit (XMC_USIC_CH_t *const channel, const uint8_t data)
 
void XMC_I2C_CH_SlaveTransmit (XMC_USIC_CH_t *const channel, const uint8_t data)
 
void XMC_I2C_CH_MasterReceiveAck (XMC_USIC_CH_t *const channel)
 
void XMC_I2C_CH_MasterReceiveNack (XMC_USIC_CH_t *const channel)
 
uint8_t XMC_I2C_CH_GetReceivedData (const XMC_USIC_CH_t *const channel)
 
XMC_I2C_CH_STATUS_t XMC_I2C_CH_Stop (XMC_USIC_CH_t *const channel)
 
void XMC_I2C_CH_EnableEvent (XMC_USIC_CH_t *const channel, const uint32_t event)
 
void XMC_I2C_CH_DisableEvent (XMC_USIC_CH_t *const channel, const uint32_t event)
 

Detailed Description

Date
2015-10-02

Definition in file xmc_i2c.c.

Macro Definition Documentation

◆ SET_TDV

#define SET_TDV   (1U)

Transmission data valid

Definition at line 76 of file xmc_i2c.c.

◆ TRANSMISSION_MODE

#define TRANSMISSION_MODE   (3U)

The shift control signal is considered active without referring to the actual signal level. Data frame transfer is possible after each edge of the signal.

Definition at line 70 of file xmc_i2c.c.

◆ WORDLENGTH

#define WORDLENGTH   (7U)

Word length

Definition at line 75 of file xmc_i2c.c.

◆ XMC_I2C_10BIT_ADDR_MASK

#define XMC_I2C_10BIT_ADDR_MASK   (0x7C00U)

Address mask for 10-bit mode

Definition at line 77 of file xmc_i2c.c.

◆ XMC_I2C_7BIT_ADDR_Pos

#define XMC_I2C_7BIT_ADDR_Pos   (8U)

7-bit address position

Definition at line 69 of file xmc_i2c.c.

Referenced by XMC_I2C_CH_GetSlaveAddress().

Typedef Documentation

◆ XMC_I2C_CH_CLOCK_OVERSAMPLINGS_t

◆ XMC_I2C_CH_MAX_SPEED_t

◆ XMC_I2C_CH_TDF_t

Enumeration Type Documentation

◆ XMC_I2C_CH_CLOCK_OVERSAMPLING

Enumerator
XMC_I2C_CH_CLOCK_OVERSAMPLING_STANDARD 
XMC_I2C_CH_CLOCK_OVERSAMPLING_FAST 

Definition at line 100 of file xmc_i2c.c.

◆ XMC_I2C_CH_MAX_SPEED

Enumerator
XMC_I2C_CH_MAX_SPEED_STANDARD 
XMC_I2C_CH_MAX_SPEED_FAST 

Definition at line 94 of file xmc_i2c.c.

◆ XMC_I2C_CH_TDF

Enumerator
XMC_I2C_CH_TDF_MASTER_SEND 
XMC_I2C_CH_TDF_SLAVE_SEND 
XMC_I2C_CH_TDF_MASTER_RECEIVE_ACK 
XMC_I2C_CH_TDF_MASTER_RECEIVE_NACK 
XMC_I2C_CH_TDF_MASTER_START 
XMC_I2C_CH_TDF_MASTER_RESTART 
XMC_I2C_CH_TDF_MASTER_STOP 

Definition at line 83 of file xmc_i2c.c.